# coding:utf8

class HtmlOutputer(object):

	def show_datas(self, datas):
		fout = open('output.html', 'w', encoding="utf-8")

		fout.write("<html>")
		fout.write("<meta charset='utf-8'>")
		fout.write("<div style='text-align: center;'><h2>女优页面</h2></div>")

		fout.write("<div>")
		fout.write("<table>")
		fout.write("<thead><th>名字</th><th>链接</th><th>图片</th></thead>")

		for data in datas:
			fout.write("<tr>")
			fout.write("<td style='width:100px'><a href='%s'>%s</a></td>"%(data['actress_url'], data['name']))
			fout.write("<td>%s</td>"%(data['actress_url']))
			fout.write("<td><img style='width:150px' src='%s'/></td>"%(data['img_url']))
			fout.write("</tr>")

		fout.write("<table>")
		fout.write("</div>")

		fout.write("</html>")
		fout.close()
